<?php
//make the date range
$date_array = array();
$local_date = date('Y-m-d');
for ($i=0; $i<24; $i++) {
	$local_hour = date('G', mktime($i, 0, 0, date('m'), date('d')));
	$date_array[$local_hour] = 0;
}

foreach ($rows as $r) {
	$date_array[$r['local_hour']] = (int)$r['visits'];
}
?>
<div class="row-fluid" style="position:relative;">
	<div id="chart-hourly" style="width:100%; height:320px;"></div>
	<div style="position:absolute;bottom:0;background:#fff;height:14px;width:30%;margin-left:70%;"></div>
</div>
<script type="text/javascript">
$(function() {
	$('#chart-hourly').highcharts({
		chart: {type: 'column'},
		title: {text: ''},
		xAxis: {categories: <?php echo json_encode(array_keys($date_array), true); ?>,
			type: 'category', tickInterval: 2
		},
		yAxis: {min: 0, title: {text: ''}, allowDecimals: false},
		series: [{
			name: 'Visits',
			data: <?php echo json_encode(array_values($date_array), true); ?>
		}]
	});
});
</script>